import time
from multiprocessing import Process, Queue


# def producer(queue):
#     queue.put(1)
#     time.sleep(2)
#
#
# def consumer(queue):
#     time.sleep(2)
#     data = queue.get()
#     print(data)


def producer(a):
    a += 1
    time.sleep(2)


def consumer(a):
    time.sleep(2)
    print(a)


if __name__ == '__main__':
    # queue = Queue(10)
    a = 1
    p = Process(target=producer, args=(a, ))
    c = Process(target=consumer, args=(a, ))
    p.start()
    c.start()
    p.join()
    c.join()

